home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format CD 52
/
Amiga Format AFCD52 (Issue 136, May 2000).iso
/
-serious-
/
programming
/
basic
/
mildred
/
lha
/
fdsexample1.lha
/
FDsMildredExample1.asc
next >
Wrap
Text File
|
1998-12-24
|
4KB
|
90 lines
;Wavey Logo Mildred Library Example.
;
;Programmed by : Mikkel Loekke, aka. FlameDuck.
;
;Please read the README file.
;
WBStartup
NoCli
INCDIR "Ram:" ; Change this to whereever you put this example.
DEFTYPE.l
degrad.q = Pi/180 ; Since the computer works in
; radians, we need this value
; to convert our angle to radians.
; (Or something) :o)
MCPU Processor ; Tell Mildred which CPU it should use.
Mc2pCPUmode Processor ; Tell Mildred which CPU it should us for c2p.
MReserveBitmaps 2 ; Tell Mildred that we're going to use 2 chunky bitmaps.
MReservec2pWindows 1 ; Tell it we only need one c2p display.
.initgraphics
MCludgeBitmap 0,320,210,?inclogo ; Go fetch our original chunky image.
MBitmap 1,384,256 ; This will contain our chunky buffer.
Mc2pWindow 0,384,256 ; Setup structures for c2p conversions.
InitBank 0,384*256,$10002 ; Get some free CHIP memory.
CludgeBitMap 0,384,256,8,Bank(0) ; And make it a planar bitmap.
Dim scrtaglst.TagItem(7) ; All this stuff sets up our
scrtaglst(0)\ti_Tag = #SA_Left ; Taglist for the screen we
scrtaglst(0)\ti_Data = -32 ; want. As you can see, it's
scrtaglst(1)\ti_Tag = #SA_Depth ; rather non-standard.
scrtaglst(1)\ti_Data = 8 ; it doesn't have to be, it's
scrtaglst(2)\ti_Tag = #SA_Width ; just that this routine needs
scrtaglst(2)\ti_Data = 384 ; a larger screen to avoid
scrtaglst(3)\ti_Tag = #SA_Height ; clipping.
scrtaglst(3)\ti_Data = 256
scrtaglst(4)\ti_Tag = #SA_BitMap
scrtaglst(4)\ti_Data = Addr BitMap (0)
scrtaglst(5)\ti_Tag = #SA_ShowTitle
scrtaglst(5)\ti_Data = 0
scrtaglst(6)\ti_Tag = #SA_Draggable
scrtaglst(6)\ti_Data = 0
scrtaglst(7)\ti_Tag = #TAG_END ; The most important tag of them all.
ScreenTags 0,"MildredDEMO",&scrtaglst(0) ; Open our intuition screen.
DecodePalette 0,?incpal ; Get our IncBin'ed palette info.
ShowPalette 0 ; Attach our palette to the screen.
MUseBitmap 1 ; Tell Mildred to use our main
; chunky buffer (just in case)
Repeat ; Repeat our mainloop ....
Mc2p Bank(0) ; Convert our chunky buffer to
; our planar bitmap.
MCls ; Clear our chunky buffer
For y=0 To 209 ; Do the sine wavey bits.
x=Sin((y+deg)*degrad*5)*30 ; Rather slow, we could easily optimise thiis bit.
; Requires an understanding for how Sine/Cosine works.
MScroll 0,y,320,1,32+x,y,0 ; Tell Mildred how to move our graphics arround, and where to put them.
; in this case we take an area 320x1 from 0,y on bitmap 0,
; and put it at 32+x,y
Next
deg+1 ; do another degree on the sinewave.
Until RawStatus($45) ; .... Until we press Escape.
End ; End our nice program.
Even ; put following data on an even address. Minor speed increase.
.incpal
IncBin "IntroLogo.PAL" ; Include our palette information in the binary.
Even ; Same as last time :o)
.inclogo
IncBin "IntroLogo.CNK" ; Include our chunky logo.